package com.nantai.jiafang.nantaijiafang.zhijian.fragment;

import android.content.Intent;
import android.view.View;

import com.nantai.jiafang.nantaijiafang.R;
import com.nantai.jiafang.nantaijiafang.base.BaseFragment;
import com.nantai.jiafang.nantaijiafang.zhijian.activity.SewingActivity;
import com.nantai.jiafang.nantaijiafang.zhijian.activity.ZhiJianActivity;
import com.nantai.jiafang.nantaijiafang.databinding.FragmentZhijianSelectBinding;

/**
 * Created by admin on 2018/3/6.
 */

public class ZhijianFragment_select extends BaseFragment<FragmentZhijianSelectBinding> implements View.OnClickListener {
    private FragmentZhijianSelectBinding mbingding;
    @Override
    public int setlayoutid() {
        return R.layout.fragment_zhijian_select;
    }

    @Override
    public void initUI(FragmentZhijianSelectBinding binding) {
        this.mbingding=binding;
        mbingding.setOnClickListener(this);
        mbingding.toolbar.setNavigationIcon(R.drawable.ic_arrow_back_black_24dp);
        //设置导航按钮的点击事件
        mbingding.toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                getFragmentManager().popBackStack();
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.RadioButton1:
                Intent _intent=new Intent(getContext(), ZhiJianActivity.class);
                _intent.putExtra("type",0);
                startActivity(_intent);
                break;
            case R.id.RadioButton2:
                Intent _intent2=new Intent(getContext(), ZhiJianActivity.class);
                _intent2.putExtra("type",1);
                startActivity(_intent2);
                break;
//                /**
            case R.id.RadioButton3:

                Intent _intent3=new Intent(getContext(), SewingActivity.class);
                _intent3.putExtra("type",0);
                startActivity(_intent3);
                break;

            case R.id.RadioButton4:
                Intent _intent4=new Intent(getContext(), SewingActivity.class);
                _intent4.putExtra("type",1);
                startActivity(_intent4);

                break;

            case R.id.RadioButton5:
                Intent _intent5=new Intent(getContext(), SewingActivity.class);
                _intent5.putExtra("type",2);
                startActivity(_intent5);
                break;

            case R.id.RadioButton6:
                Intent _intent6=new Intent(getContext(),SewingActivity.class);
                _intent6.putExtra("type",3);
                startActivity(_intent6);
                break;

            case R.id.RadioButton7:
                Intent _intent7=new Intent(getContext(),SewingActivity.class);
                _intent7.putExtra("type",4);
                startActivity(_intent7);
                break;
//                */

        }
    }
}
